using CodePlex.CodePlexClientLibrary;

namespace CodePlex.TeamFoundationClient
{
    [Command("help", "Describe the usage of this program and its commands.", AltName = "?", MaxArgs = 1, UsageSummary = "[command]")]
    public class HelpCommand : Command
    {
        readonly HelpConsoleView view;

        public HelpCommand(CommandLineHelper commandLineHelper)
        {
            view = new HelpConsoleView(commandLineHelper,
                                       "tfc",
                                       "Team Foundation command-line source control client",
                                       "http://www.codeplex.com/CodePlexClient");
        }

        public override void Execute()
        {
            if (Arguments.Count == 0)
                view.ViewHelp();
            else
                view.ViewHelpForCommand(Arguments[0]);
        }
    }
}